package com.fucai.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.fucai.controller.vo.Fucai3dDingweiDTO;
import com.fucai.entity.Fucai3dDingwei;
import com.fucai.service.Fucai3dDingweiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * @description: 福彩3D每日定位
 * @author: zhuchi
 * @create: 2025-06-21 13:51
 * @Version 1.0
 **/
@Api(tags = "福彩3D每日定位")
@Slf4j
@RestController
@RequestMapping("/fucai/3d/dingwei")
public class Fucai3dDingweiController {

    @Resource
    private Fucai3dDingweiService fucai3dDingweiService;

    /**
     * 查询定位信息
     * @param reqVO
     * @return
     */
    @ApiOperation(value = "查询定位信息")
    @PostMapping("/selectDingwei")
    public List<Fucai3dDingweiDTO> selectDingwei(@RequestBody Fucai3dDingwei reqVO){
        List<Fucai3dDingweiDTO> result = fucai3dDingweiService.selectDingweiByQihao(reqVO);

        return result;
    }

    /**
     * 添加、修改定位信息
     * @param reqVO
     * @return
     */
    @ApiOperation(value = "添加、修改定位信息")
    @PostMapping("/addOrEditDingwei")
    public Boolean addOrEditDingwei(@RequestBody Fucai3dDingwei reqVO){
        Boolean result = fucai3dDingweiService.addOrEditDingwei(reqVO);
        return result;
    }


    /**
     * 根据历史添加定位信息
     * @return
     */
    @ApiOperation(value = "根据历史添加定位信息")
    @PostMapping("/addDingweiByHistory")
    public Boolean addDingweiByHistory(@RequestParam(value = "id", required = false) Integer id){
//        fucai3dDingweiService.assignDingwei();
        fucai3dDingweiService.addDingweiByHistory(id);
//        fucai3dDingweiService.update();
        return true;
    }
}
